<?php $user=Member::model()->find("username=:username",array("username"=>$_GET['username']));?>

<?php $this->beginContent('//layouts/main'); ?>
<div class="navbar">
	<div class="navbar-inner">
		<div class="container">
			<?php echo CHtml::link(CHtml::image(Utils::getImageUrlById("common", "", "home"),Yii::app()->name),array("site/index"),array("class"=>'brand'))?>
			<?php echo CHtml::link($user->title,array("event/list","username"=>$user->username),array("class"=>'brand'))?>
			<div class="nav-collapse">
				<?php
				$navs = array(
						array('label'=>'活动', 'url'=>array('event/list','username'=>$user->username)),
						array('label'=>'博客', 'url'=>array('node/list','id'=>$user->id,'username'=>$user->username))
				);
				$nodes = Node::model()->findAll("member_id = :member_id and type=:type and parent_id=:parent_id",array("member_id"=>$user->id, "type"=>Node::TYPE_PAGE,'parent_id'=>0));
				foreach ($nodes as $node){
					array_push($navs,array('label'=>$node->title,'url'=>array('node/view',"id"=>$node->id,'username'=>$user->username)));
				}
				if(Utils::displayBtn("")){
					array_push($navs,array('label'=>'+ 添加','url'=>array("node/add",'type'=>Node::TYPE_PAGE,'username'=>$user->username)));
				}
				$this->widget('zii.widgets.CMenu', array(
						'items'=>$navs,
						'htmlOptions'=>array("class"=>'nav'),
				));
				?>
				<ul class="nav pull-right">
					<?php if(!Yii::app()->user->isGuest && Yii::app()->user->id == $user->id):?>
					<?php $member=Member::model()->findByPk(Yii::app()->user->id); ?>
					<li><?php echo CHtml::link('<i class="icon-user icon-white"></i> 退出',array("site/logout"));?>
					</li>
					<?php endif;?>
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</div>
</div>
<div class="container">
	<div class="row">
		<?php echo $content?>
	</div>

</div>
<?php $this->endContent(); ?>
